<?php
include('confdb.php');

$sud = $_POST['sud'] ?? '';
$ids = $_POST['ids'] ?? '';

$con = mysqli_connect($db_host, $db_user, $db_pass, $db_name);

if(!$con) {
    die ('Ошибка подключения: '.mysqli_connect_error());
} 
$otvet= array();
$query = "INSERT INTO sudgotov (vistuplenie_idvistuplenie, nomersud) VALUES ('$ids', '$sud')";
$result = mysqli_query($con, $query);

if($result){
    $otvet['success']=1;
} else { $otvet['success']=0; }
    echo json_encode($otvet);
?>